#ifndef __SB_MAIN_H__
#define __SB_MAIN_H__

#include "sbconstant.h"

#define SB_MAX_WORKERS_NUM			50

#define SB_SYS_CMD_QUICKEXIT                    1
#define SB_SYS_CMD_SLOWEXIT                     2
#define SB_SYS_CMD_RELOADCONF                   4

#define SB_TYPE_WORKER	1
#define SB_TYPE_DNS	2

extern struct timeval  cache_time;
extern char cache_str_time[sizeof("2014-12-12 12:12:12")];
struct sb_channel
{
	int channel[2];
	pid_t pid;
	char log_pathfilename[SYS_CONFIG_PATHFILE_NAME + 1];
	FILE *log_file;
	
	int type;
};

struct sb_env
{
	int http_proxy;
	int log_level;
	char config_pathfilename[SYS_CONFIG_PATHFILE_NAME + 1];
	char log_pathfilename[SYS_CONFIG_PATHFILE_NAME + 1];
	FILE *log_file;
	int workers_num;

	int msgqueueid;
	int shmid;
	sb_atomic_t *accept_lock;
};

#endif
